//
//  HWHeadTableViewCell.m
//  JWC
//
//  Created by lanou on 16/4/16.
//  Copyright © 2016年 陈帅. All rights reserved.
//

#import "HWHeadTableViewCell.h"
#import "UIImageView+WebCache.h"

@interface HWHeadTableViewCell ()

@property (weak, nonatomic) IBOutlet UIImageView *backgroundImg;

@property (weak, nonatomic) IBOutlet UIImageView *headImg;

@property (weak, nonatomic) IBOutlet UILabel *gradeText;

@property (weak, nonatomic) IBOutlet UILabel *interText;

@property (weak, nonatomic) IBOutlet UILabel *likeText;

@property (weak, nonatomic) IBOutlet UILabel *fansText;

@property (weak, nonatomic) IBOutlet UILabel *jianText;

@property (weak, nonatomic) IBOutlet UILabel *renText;

@property (weak, nonatomic) IBOutlet UIImageView *sex;

@property (weak, nonatomic) IBOutlet UILabel *name;

@end

@implementation HWHeadTableViewCell

+ (instancetype)cell
{
    return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] firstObject];
}

- (void)setModel:(HWDetailModel *)model
{
    _model = model;
    
    [self.backgroundImg sd_setImageWithURL:[NSURL URLWithString:model.background_image]];
    [self.headImg sd_setImageWithURL:[NSURL URLWithString:model.profile_image]];
    self.sex.image = [model.sex isEqualToString:@"m"] ? [UIImage imageNamed:@"Profile_manIcon"] : [UIImage imageNamed:@"Profile_womanIcon"];
    
    NSInteger grade = model.experience / 500;
    self.gradeText.text = [NSString stringWithFormat:@"等级:LV%ld", grade];
    self.interText.text = [NSString stringWithFormat:@"积分:%ld", model.credit];
    self.likeText.text = [NSString stringWithFormat:@"关注:%@", model.follow_count];
    self.fansText.text = [NSString stringWithFormat:@"粉丝:%@", model.fans_count];
    self.jianText.text = [NSString stringWithFormat:@"简介:%@", model.introduction];
    self.renText.text = [NSString stringWithFormat:@"认证:%@", model.v_desc];
    self.name.text = model.username;
    
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end


























